/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model.acl;

/**
 *
 * @author Anthares
 */

public class UserType{

    private String roleName;
    
    private UserType parent;

    public UserType(String type) {
        this.roleName = type;
        this.parent=null;
    }

    public UserType(String roleName, UserType parent) {
        this.roleName = roleName;
        this.parent = parent;
    }

    public String getType() {
        return roleName;
    }
    
    public boolean isA(String role){
        if(roleName.equals(role)) {
            return true;
        }
        if(parent==null) {
            return false;
        }
        return parent.isA(role);
    }
}
